Code formatting
authorRaymond Penners <pennersr@src.gnome.org>
Wed, 22 Oct 2003 18:25:50 +0000 (18:25 +0000)
committerRaymond Penners <pennersr@src.gnome.org>
Wed, 22 Oct 2003 18:25:50 +0000 (18:25 +0000)
modules/engines/ms-windows/ChangeLog.old
modules/engines/ms-windows/wimp_style.c
modules/engines/ms-windows/xp_theme.c
modules/engines/ms-windows/xp_theme.h

index 003b9e851cf442e8e09a900fadd5fe6f74d24c61..7977a48c6fc943a5fffa693d5e93988b0a8dc1c2 100755 (executable)
@@ -1,12 +1,14 @@
+2003-10-22  Raymond Penners  <raymond@dotsphinx.com>\r
+\r
+       * src/*.[ch]: Code formatting & XP constants renaming.\r
+\r
 2003-10-21  Dom Lachowicz <cinamod@hotmail.com>\r
 \r
-       * src/wimp_style.c: Use theme colors\r
-       Use theme metrics\r
-       (disabled) Use theme fonts\r
-       Theme menu items, menu separators\r
-       Draw status bar resize grips\r
+       * src/wimp_style.c: Use theme colors, use theme metrics\r
+       (disabled), use theme fonts, theme menu items, menu separators,\r
+       draw status bar resize grips.\r
 \r
-       * src/xp_theme.c: Ditto\r
+       * src/xp_theme.c: Ditto.\r
        \r
 2003-10-20  Raymond Penners  <raymond@dotsphinx.com>\r
 \r
index 95a9e2b62ef0c63f52c24e3095320193951fabc5..9421cd2b77c05190af6f0a865e1c7bc6167bfe7b 100755 (executable)
@@ -333,12 +333,12 @@ sys_color_to_gtk_color(XpThemeClass klazz, int id, GdkColor *pcolor)
 static int
 get_system_metric(XpThemeClass klazz, int id)
 {
-       int rval;
+  int rval;
 
-       if (!xp_theme_get_system_metric(klazz, id, &rval))
-               rval = GetSystemMetrics (id);
+  if (!xp_theme_get_system_metric(klazz, id, &rval))
+    rval = GetSystemMetrics (id);
 
-       return rval;
+  return rval;
 }
 
 static void
@@ -1044,7 +1044,7 @@ draw_arrow (GtkStyle      *style,
       /* draw the toolbar chevrons - waiting for GTK 2.4 */
          if (name && !strcmp (name, "gtk-toolbar-arrow"))
          {
-                 if (xp_theme_draw(window, XP_THEME_ELEMENT_CHEVRON, style, x, y, width, height, state, area))
+                 if (xp_theme_draw(window, XP_THEME_ELEMENT_REBAR_CHEVRON, style, x, y, width, height, state, area))
                                return;
          }
 
@@ -1164,8 +1164,8 @@ draw_box (GtkStyle      *style,
             {
               xp_theme_draw(window,
                             is_v
-                            ? XP_THEME_ELEMENT_GRIP_V
-                            : XP_THEME_ELEMENT_GRIP_H,
+                            ? XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_V
+                            : XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_H,
                             style, x, y, width, height, state_type, area);
               return;
             }
@@ -1569,9 +1569,9 @@ draw_handle (GtkStyle        *style,
       sanitize_size (window, &width, &height);
 
       if (orientation == GTK_ORIENTATION_VERTICAL)
-        hndl = XP_THEME_ELEMENT_GRIPPER_V;
+        hndl = XP_THEME_ELEMENT_REBAR_GRIPPER_V;
       else
-        hndl = XP_THEME_ELEMENT_GRIPPER_H;
+        hndl = XP_THEME_ELEMENT_REBAR_GRIPPER_H;
 
       if (xp_theme_draw (window, hndl, style, x, y, width, height,
                          state_type, area))
index 1fb1116d168285d640e00a9a1da95a5ad068c304..5402e1ffd33771e943b8858f1e53d2befb09a908 100755 (executable)
@@ -229,9 +229,9 @@ xp_theme_get_handle_by_element (XpThemeElement element)
       break;
 
     case XP_THEME_ELEMENT_REBAR:
-    case XP_THEME_ELEMENT_GRIPPER_H:
-    case XP_THEME_ELEMENT_GRIPPER_V:
-    case XP_THEME_ELEMENT_CHEVRON:
+    case XP_THEME_ELEMENT_REBAR_GRIPPER_H:
+    case XP_THEME_ELEMENT_REBAR_GRIPPER_V:
+    case XP_THEME_ELEMENT_REBAR_CHEVRON:
       klazz = XP_THEME_CLASS_REBAR;
       break;
 
@@ -284,8 +284,8 @@ xp_theme_get_handle_by_element (XpThemeElement element)
     case XP_THEME_ELEMENT_ARROW_DOWN:
     case XP_THEME_ELEMENT_ARROW_LEFT:
     case XP_THEME_ELEMENT_ARROW_RIGHT:
-    case XP_THEME_ELEMENT_GRIP_V:
-    case XP_THEME_ELEMENT_GRIP_H:
+    case XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_V:
+    case XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_H:
     case XP_THEME_ELEMENT_TROUGH_V:
     case XP_THEME_ELEMENT_TROUGH_H:
       klazz = XP_THEME_CLASS_SCROLLBAR;
@@ -332,8 +332,8 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
       break;
 
     case XP_THEME_ELEMENT_REBAR:
-    case XP_THEME_ELEMENT_GRIPPER_H:
-    case XP_THEME_ELEMENT_GRIPPER_V:
+    case XP_THEME_ELEMENT_REBAR_GRIPPER_H:
+    case XP_THEME_ELEMENT_REBAR_GRIPPER_V:
       ret = CHEVS_NORMAL;
       break;
 
@@ -342,7 +342,7 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
                ret = 1;
                break;
 
-    case XP_THEME_ELEMENT_CHEVRON:
+    case XP_THEME_ELEMENT_REBAR_CHEVRON:
       switch (state)
        {
         case GTK_STATE_PRELIGHT:
@@ -713,8 +713,8 @@ xp_theme_draw (GdkWindow *win, XpThemeElement element, GtkStyle *style,
   part_state = xp_theme_map_gtk_state(element, state_type);
 
 #ifdef GNATS_HACK
-  if (element == XP_THEME_ELEMENT_GRIPPER_V
-      || element == XP_THEME_ELEMENT_GRIPPER_H)
+  if (element == XP_THEME_ELEMENT_REBAR_GRIPPER_V
+      || element == XP_THEME_ELEMENT_REBAR_GRIPPER_H)
     {
       /* Hack alert: when XP draws a gripper, it does not seem to fill
          up the whole rectangle. It only fills the gripper line
@@ -764,49 +764,52 @@ xp_theme_get_system_font (XpThemeClass klazz, XpThemeFont fontId, LOGFONT *lf)
 
   if (get_theme_sys_font_func != NULL)
     {
-         HTHEME theme = xp_theme_get_handle_by_class(klazz);
-         if (!theme)
-               return FALSE;
-
-       switch (fontId){
-               case XP_THEME_FONT_CAPTION:
-                       themeFont = TMT_CAPTIONFONT; break;
-               case XP_THEME_FONT_MENU:
-                       themeFont = TMT_MENUFONT; break;
-               case XP_THEME_FONT_STATUS:
-                       themeFont = TMT_STATUSFONT; break;
-               case XP_THEME_FONT_MESSAGE:
-               default:
-                       themeFont = TMT_MSGBOXFONT; break;
-       }
-         /* if theme is NULL, it will just return the GetSystemFont() value */
+      HTHEME theme = xp_theme_get_handle_by_class(klazz);
+      if (!theme)
+        return FALSE;
+
+      switch (fontId)
+        {
+        case XP_THEME_FONT_CAPTION:
+          themeFont = TMT_CAPTIONFONT; break;
+        case XP_THEME_FONT_MENU:
+          themeFont = TMT_MENUFONT; break;
+        case XP_THEME_FONT_STATUS:
+          themeFont = TMT_STATUSFONT; break;
+        case XP_THEME_FONT_MESSAGE:
+        default:
+          themeFont = TMT_MSGBOXFONT; break;
+        }
+      /* if theme is NULL, it will just return the GetSystemFont() value */
       return ((*get_theme_sys_font_func)(theme, themeFont, lf) == S_OK);
     }
   return FALSE;
 }
 
-gboolean xp_theme_get_system_color (XpThemeClass klazz, int colorId, DWORD * pColor)
+gboolean
+xp_theme_get_system_color (XpThemeClass klazz, int colorId, DWORD * pColor)
 {
   if (get_theme_sys_color_func != NULL)
     {
-          HTHEME theme = xp_theme_get_handle_by_class(klazz);
+      HTHEME theme = xp_theme_get_handle_by_class(klazz);
 
-          /* if theme is NULL, it will just return the GetSystemColor() value */
-          *pColor = (*get_theme_sys_color_func)(theme, colorId);
-          return TRUE;
+      /* if theme is NULL, it will just return the GetSystemColor() value */
+      *pColor = (*get_theme_sys_color_func)(theme, colorId);
+      return TRUE;
     }
   return FALSE;
 }
 
-gboolean xp_theme_get_system_metric (XpThemeClass klazz, int metricId, int * pVal)
+gboolean
+xp_theme_get_system_metric (XpThemeClass klazz, int metricId, int * pVal)
 {
   if (get_theme_sys_metric_func != NULL)
     {
-          HTHEME theme = xp_theme_get_handle_by_class(klazz);
+      HTHEME theme = xp_theme_get_handle_by_class(klazz);
 
-          /* if theme is NULL, it will just return the GetSystemMetrics() value */
-          *pVal = (*get_theme_sys_metric_func)(theme, metricId);
-          return TRUE;
+      /* if theme is NULL, it will just return the GetSystemMetrics() value */
+      *pVal = (*get_theme_sys_metric_func)(theme, metricId);
+      return TRUE;
     }
   return FALSE;
 }
index 593144398ffcf36fe8a516809c4d0458800630d4..d9ca0d7c73f02c0294b28878ee42809721eed6ea 100755 (executable)
@@ -62,8 +62,8 @@ typedef enum
   XP_THEME_ELEMENT_ARROW_DOWN,\r
   XP_THEME_ELEMENT_ARROW_LEFT,\r
   XP_THEME_ELEMENT_ARROW_RIGHT,\r
-  XP_THEME_ELEMENT_GRIP_H,\r
-  XP_THEME_ELEMENT_GRIP_V,\r
+  XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_H,\r
+  XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_V,\r
   XP_THEME_ELEMENT_TROUGH_H,\r
   XP_THEME_ELEMENT_TROUGH_V,\r
   XP_THEME_ELEMENT_EDIT_TEXT,\r
@@ -80,9 +80,9 @@ typedef enum
   XP_THEME_ELEMENT_PROGRESS_TROUGH_V,\r
   XP_THEME_ELEMENT_TOOLTIP,\r
   XP_THEME_ELEMENT_REBAR,\r
-  XP_THEME_ELEMENT_GRIPPER_H,\r
-  XP_THEME_ELEMENT_GRIPPER_V,\r
-  XP_THEME_ELEMENT_CHEVRON,\r
+  XP_THEME_ELEMENT_REBAR_GRIPPER_H,\r
+  XP_THEME_ELEMENT_REBAR_GRIPPER_V,\r
+  XP_THEME_ELEMENT_REBAR_CHEVRON,\r
   XP_THEME_ELEMENT_TOOLBAR,\r
   XP_THEME_ELEMENT_MENUITEM,\r
   XP_THEME_ELEMENT_MENU_SEPARATOR,\r
@@ -95,10 +95,10 @@ typedef enum
 \r
 typedef enum\r
 {\r
-       XP_THEME_FONT_CAPTION,\r
-       XP_THEME_FONT_MENU,\r
-       XP_THEME_FONT_STATUS,\r
-       XP_THEME_FONT_MESSAGE\r
+  XP_THEME_FONT_CAPTION,\r
+  XP_THEME_FONT_MENU,\r
+  XP_THEME_FONT_STATUS,\r
+  XP_THEME_FONT_MESSAGE\r
 } XpThemeFont;\r
 \r
 void xp_theme_init (void);\r